Configure iSCSI Initiator
2015/12/02 |
Configure iSCSI Initiator.
This example is based on the environment below.
+----------------------+ | +----------------------+ | [ iSCSI Target ] |10.0.0.30 | 10.0.0.31| [ iSCSI Initiator ] | | dlp.srv.world +----------+----------+ client.srv.world | | | | | +----------------------+ +----------------------+ |
[1] | Configure iSCSI Initiator. |
client:~#
zypper -n install open-iscsi
client:~#
vi /etc/iscsi/iscsid.conf # line 58: uncomment node.session.auth.authmethod = CHAP # line 62,63: uncomment and set username and password which set on iSCSI Target node.session.auth.username = username node.session.auth.password = password
# discover target client:~# iscsiadm -m discovery -t sendtargets -p 10.0.0.30 Loading iscsi modules: tcp done Starting iSCSI initiator service: done Setting up iSCSI targets: unused 10.0.0.30:3260,1 iqn.2015-12.world.srv:target00 # confirm status after discovery client:~# iscsiadm -m node -o show
# BEGIN RECORD 2.0-873.suse
node.name = iqn.2015-12.world.srv:target00 node.tpgt = 1 node.startup = manual node.leading_login = No ..... ..... # login to target client:~# iscsiadm -m node --login
Logging in to [iface: default, target: iqn.2015-12.world.srv:target00, portal: 10.0.0.30,3260] (multiple)
Login to [iface: default, target: iqn.2015-12.world.srv:target00, portal: 10.0.0.30,3260] successful. # confirm established session client:~# iscsiadm -m session -o show
tcp: [1] 10.0.0.30:3260,1 iqn.2015-12.world.srv:target00 (non-flash)
# confirm partitions client:~# cat /proc/partitions major minor #blocks name 253 0 31457348 sda 253 1 2103296 sda1 253 2 29352960 sda2 8 0 10485760 sdb # added new device provided from target as [sdb] |
[2] | It's possible to use iSCSI device like follows. |
client:~#
zypper -n install parted # create a label client:~# parted --script /dev/sdb "mklabel msdos" # create a partition client:~# parted --script /dev/sdb "mkpart primary 0% 100%" # format with EXT4 client:~# mkfs.ext4 /dev/sdb1
# mount client:~# mount /dev/sdb1 /mnt client:~# df -hT Filesystem Type Size Used Avail Use% Mounted on /dev/sda2 ext3 28G 3.3G 24G 13% / udev tmpfs 1.9G 108K 1.9G 1% /dev tmpfs tmpfs 1.9G 648K 1.9G 1% /dev/shm /dev/sdb1 ext4 9.9G 151M 9.2G 2% /mnt |